package com.bestdreamer.atomic;

public class Demo1Run {

    public static void main(String[] args) {
        try {
            Demo1MyService service = new Demo1MyService();
            Demo1MyThread[] array = new Demo1MyThread[5];

            for( int i = 0; i< array.length; i++){
                array[i] = new Demo1MyThread(service);
            }
            for( int i = 0; i < array.length; i++){
                array[i].start();
            }
            Thread.sleep(1000);
            System.out.println(Demo1MyService.aiRef.get());
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

    }

}
